package o;

import com.huawei.appgallery.festivalanimation.particle.modifiers.SizeModifier;
import com.huawei.hwid.core.constants.HwAccountConstants;
import o.eh.d;

public class ec implements d {
    float ˊ = 0.0f;
    public final eb ˋ;
    eh ˎ = null;
    boolean ˏ = false;
    boolean ॱ = false;

    public ec(ee eeVar) {
        this.ˋ = new eb(this, eeVar);
    }

    boolean ˏ() {
        return this.ˎ != null && (this.ˎ.ʽ == d.UNRESTRICTED || this.ˊ >= 0.0f);
    }

    public String toString() {
        return ˊ();
    }

    String ˊ() {
        String str;
        Object obj;
        String str2 = "";
        if (this.ˎ == null) {
            str2 = str2 + "0";
        } else {
            str2 = str2 + this.ˎ;
        }
        str2 = str2 + " = ";
        if (this.ˊ != 0.0f) {
            str = str2 + this.ˊ;
            obj = 1;
        } else {
            str = str2;
            obj = null;
        }
        int i = this.ˋ.ˎ;
        String str3 = str;
        for (int i2 = 0; i2 < i; i2++) {
            eh ˊ = this.ˋ.ˊ(i2);
            if (ˊ != null) {
                float ˋ = this.ˋ.ˋ(i2);
                if (ˋ != 0.0f) {
                    float f;
                    String ehVar = ˊ.toString();
                    if (obj == null) {
                        if (ˋ < 0.0f) {
                            str3 = str3 + "- ";
                            f = ˋ * SizeModifier.STABLE_STATE_SCALE;
                        } else {
                            f = ˋ;
                        }
                    } else if (ˋ > 0.0f) {
                        str3 = str3 + " + ";
                        f = ˋ;
                    } else {
                        str3 = str3 + " - ";
                        f = ˋ * SizeModifier.STABLE_STATE_SCALE;
                    }
                    if (f == 1.0f) {
                        str2 = str3 + ehVar;
                    } else {
                        str2 = str3 + f + HwAccountConstants.BLANK + ehVar;
                    }
                    str3 = str2;
                    int i3 = 1;
                }
            }
        }
        if (obj == null) {
            return str3 + "0.0";
        }
        return str3;
    }

    public void ˎ() {
        this.ˎ = null;
        this.ˋ.ˎ();
        this.ˊ = 0.0f;
        this.ˏ = false;
    }

    boolean ॱ(eh ehVar) {
        return this.ˋ.ˎ(ehVar);
    }

    ec ˊ(eh ehVar, int i) {
        this.ˎ = ehVar;
        ehVar.ˎ = (float) i;
        this.ˊ = (float) i;
        this.ˏ = true;
        return this;
    }

    public ec ˋ(eh ehVar, int i) {
        if (i < 0) {
            this.ˊ = (float) (i * -1);
            this.ˋ.ॱ(ehVar, 1.0f);
        } else {
            this.ˊ = (float) i;
            this.ˋ.ॱ(ehVar, (float) SizeModifier.STABLE_STATE_SCALE);
        }
        return this;
    }

    public ec ˎ(eh ehVar, eh ehVar2, int i) {
        Object obj = null;
        if (i != 0) {
            if (i < 0) {
                i *= -1;
                obj = 1;
            }
            this.ˊ = (float) i;
        }
        if (obj == null) {
            this.ˋ.ॱ(ehVar, (float) SizeModifier.STABLE_STATE_SCALE);
            this.ˋ.ॱ(ehVar2, 1.0f);
        } else {
            this.ˋ.ॱ(ehVar, 1.0f);
            this.ˋ.ॱ(ehVar2, (float) SizeModifier.STABLE_STATE_SCALE);
        }
        return this;
    }

    ec ˏ(eh ehVar, int i) {
        this.ˋ.ॱ(ehVar, (float) i);
        return this;
    }

    public ec ˊ(eh ehVar, eh ehVar2, eh ehVar3, int i) {
        Object obj = null;
        if (i != 0) {
            if (i < 0) {
                i *= -1;
                obj = 1;
            }
            this.ˊ = (float) i;
        }
        if (obj == null) {
            this.ˋ.ॱ(ehVar, (float) SizeModifier.STABLE_STATE_SCALE);
            this.ˋ.ॱ(ehVar2, 1.0f);
            this.ˋ.ॱ(ehVar3, 1.0f);
        } else {
            this.ˋ.ॱ(ehVar, 1.0f);
            this.ˋ.ॱ(ehVar2, (float) SizeModifier.STABLE_STATE_SCALE);
            this.ˋ.ॱ(ehVar3, (float) SizeModifier.STABLE_STATE_SCALE);
        }
        return this;
    }

    public ec ॱ(eh ehVar, eh ehVar2, eh ehVar3, int i) {
        Object obj = null;
        if (i != 0) {
            if (i < 0) {
                i *= -1;
                obj = 1;
            }
            this.ˊ = (float) i;
        }
        if (obj == null) {
            this.ˋ.ॱ(ehVar, (float) SizeModifier.STABLE_STATE_SCALE);
            this.ˋ.ॱ(ehVar2, 1.0f);
            this.ˋ.ॱ(ehVar3, (float) SizeModifier.STABLE_STATE_SCALE);
        } else {
            this.ˋ.ॱ(ehVar, 1.0f);
            this.ˋ.ॱ(ehVar2, (float) SizeModifier.STABLE_STATE_SCALE);
            this.ˋ.ॱ(ehVar3, 1.0f);
        }
        return this;
    }

    public ec ˊ(float f, float f2, float f3, eh ehVar, eh ehVar2, eh ehVar3, eh ehVar4) {
        this.ˊ = 0.0f;
        if (f2 == 0.0f || f == f3) {
            this.ˋ.ॱ(ehVar, 1.0f);
            this.ˋ.ॱ(ehVar2, (float) SizeModifier.STABLE_STATE_SCALE);
            this.ˋ.ॱ(ehVar4, 1.0f);
            this.ˋ.ॱ(ehVar3, (float) SizeModifier.STABLE_STATE_SCALE);
        } else if (f == 0.0f) {
            this.ˋ.ॱ(ehVar, 1.0f);
            this.ˋ.ॱ(ehVar2, (float) SizeModifier.STABLE_STATE_SCALE);
        } else if (f3 == 0.0f) {
            this.ˋ.ॱ(ehVar3, 1.0f);
            this.ˋ.ॱ(ehVar4, (float) SizeModifier.STABLE_STATE_SCALE);
        } else {
            float f4 = (f / f2) / (f3 / f2);
            this.ˋ.ॱ(ehVar, 1.0f);
            this.ˋ.ॱ(ehVar2, (float) SizeModifier.STABLE_STATE_SCALE);
            this.ˋ.ॱ(ehVar4, f4);
            this.ˋ.ॱ(ehVar3, -f4);
        }
        return this;
    }

    ec ॱ(eh ehVar, eh ehVar2, int i, float f, eh ehVar3, eh ehVar4, int i2) {
        if (ehVar2 == ehVar3) {
            this.ˋ.ॱ(ehVar, 1.0f);
            this.ˋ.ॱ(ehVar4, 1.0f);
            this.ˋ.ॱ(ehVar2, -2.0f);
        } else if (f == 0.5f) {
            this.ˋ.ॱ(ehVar, 1.0f);
            this.ˋ.ॱ(ehVar2, (float) SizeModifier.STABLE_STATE_SCALE);
            this.ˋ.ॱ(ehVar3, (float) SizeModifier.STABLE_STATE_SCALE);
            this.ˋ.ॱ(ehVar4, 1.0f);
            if (i > 0 || i2 > 0) {
                this.ˊ = (float) ((-i) + i2);
            }
        } else if (f <= 0.0f) {
            this.ˋ.ॱ(ehVar, (float) SizeModifier.STABLE_STATE_SCALE);
            this.ˋ.ॱ(ehVar2, 1.0f);
            this.ˊ = (float) i;
        } else if (f >= 1.0f) {
            this.ˋ.ॱ(ehVar3, (float) SizeModifier.STABLE_STATE_SCALE);
            this.ˋ.ॱ(ehVar4, 1.0f);
            this.ˊ = (float) i2;
        } else {
            this.ˋ.ॱ(ehVar, (1.0f - f) * 1.0f);
            this.ˋ.ॱ(ehVar2, (1.0f - f) * SizeModifier.STABLE_STATE_SCALE);
            this.ˋ.ॱ(ehVar3, SizeModifier.STABLE_STATE_SCALE * f);
            this.ˋ.ॱ(ehVar4, 1.0f * f);
            if (i > 0 || i2 > 0) {
                this.ˊ = (((float) (-i)) * (1.0f - f)) + (((float) i2) * f);
            }
        }
        return this;
    }

    public ec ˋ(ea eaVar, int i) {
        this.ˋ.ॱ(eaVar.ˋ(i, "ep"), 1.0f);
        this.ˋ.ॱ(eaVar.ˋ(i, "em"), (float) SizeModifier.STABLE_STATE_SCALE);
        return this;
    }

    ec ˊ(eh ehVar, eh ehVar2, eh ehVar3, float f) {
        this.ˋ.ॱ(ehVar, (float) SizeModifier.STABLE_STATE_SCALE);
        this.ˋ.ॱ(ehVar2, 1.0f - f);
        this.ˋ.ॱ(ehVar3, f);
        return this;
    }

    public ec ˎ(eh ehVar, eh ehVar2, eh ehVar3, eh ehVar4, float f) {
        this.ˋ.ॱ(ehVar, (float) SizeModifier.STABLE_STATE_SCALE);
        this.ˋ.ॱ(ehVar2, 1.0f);
        this.ˋ.ॱ(ehVar3, f);
        this.ˋ.ॱ(ehVar4, -f);
        return this;
    }

    public ec ˊ(eh ehVar, eh ehVar2, eh ehVar3, eh ehVar4, float f) {
        this.ˋ.ॱ(ehVar3, 0.5f);
        this.ˋ.ॱ(ehVar4, 0.5f);
        this.ˋ.ॱ(ehVar, -0.5f);
        this.ˋ.ॱ(ehVar2, -0.5f);
        this.ˊ = -f;
        return this;
    }

    void ॱ() {
        if (this.ˊ < 0.0f) {
            this.ˊ *= SizeModifier.STABLE_STATE_SCALE;
            this.ˋ.ॱ();
        }
    }

    boolean ˎ(ea eaVar) {
        boolean z = false;
        eh ˎ = this.ˋ.ˎ(eaVar);
        if (ˎ == null) {
            z = true;
        } else {
            ˎ(ˎ);
        }
        if (this.ˋ.ˎ == 0) {
            this.ˏ = true;
        }
        return z;
    }

    eh ˏ(eh ehVar) {
        return this.ˋ.ॱ(null, ehVar);
    }

    void ˎ(eh ehVar) {
        if (this.ˎ != null) {
            this.ˋ.ॱ(this.ˎ, (float) SizeModifier.STABLE_STATE_SCALE);
            this.ˎ = null;
        }
        float ˎ = this.ˋ.ˎ(ehVar, true) * SizeModifier.STABLE_STATE_SCALE;
        this.ˎ = ehVar;
        if (ˎ != 1.0f) {
            this.ˊ /= ˎ;
            this.ˋ.ˎ(ˎ);
        }
    }

    public boolean ˋ() {
        return this.ˎ == null && this.ˊ == 0.0f && this.ˋ.ˎ == 0;
    }

    public eh ˊ(ea eaVar, boolean[] zArr) {
        return this.ˋ.ॱ(zArr, null);
    }

    public void ʽ() {
        this.ˋ.ˎ();
        this.ˎ = null;
        this.ˊ = 0.0f;
    }

    public void ˊ(d dVar) {
        if (dVar instanceof ec) {
            ec ecVar = (ec) dVar;
            this.ˎ = null;
            this.ˋ.ˎ();
            for (int i = 0; i < ecVar.ˋ.ˎ; i++) {
                this.ˋ.ॱ(ecVar.ˋ.ˊ(i), ecVar.ˋ.ˋ(i), true);
            }
        }
    }

    public void ˊ(eh ehVar) {
        float f = 1.0f;
        if (ehVar.ˏ != 1) {
            if (ehVar.ˏ == 2) {
                f = 1000.0f;
            } else if (ehVar.ˏ == 3) {
                f = 1000000.0f;
            } else if (ehVar.ˏ == 4) {
                f = 1.0E9f;
            } else if (ehVar.ˏ == 5) {
                f = 1.0E12f;
            }
        }
        this.ˋ.ॱ(ehVar, f);
    }

    public eh ʼ() {
        return this.ˎ;
    }
}
